<template>
  <div>
    <el-container style="height: 100vh">
      <el-aside width= "sideWidth" style="height: 100% ; background-color: rgb(238, 241, 246)">
        <MyAside :isCollapse="isCollapse" :logoTextShow="logoTextShow"/>
      </el-aside>

      <el-container>
        <el-header style="font-size: 12px; border-bottom: 1px solid black">
          <Header :collapseBtnClass="collapseBtnClass" :collapse="collapse"/>
        </el-header>

        <el-main>
          <router-view/>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>

import MyAside from "@/components/MyAside";
import Header from "@/components/Header";
export default {
  data() {
    return {
      collapseBtnClass:'el-icon-s-fold',
      isCollapse:false,
      sideWidth:"230px",
      logoTextShow:true
    }
  },
  components:{
    Header,
    MyAside

  },
  methods:{
    collapse(){
      this.isCollapse=! this.isCollapse;
      if(this.isCollapse){
        this.sideWidth="64px"
        this.collapseBtnClass='el-icon-s-unfold'
        this.logoTextShow=false
      }else {
        this.sideWidth="230px"
        this.collapseBtnClass='el-icon-s-fold'
        this.logoTextShow=true
      }
    },
    handleCurrentChange(pageNum){
      this.pageNum=pageNum
      this.load()
    },
    handleSizeChange(pageSize){
      this.pageSize=pageSize
      this.load()
    }

  }
}
</script>